package com.bone.workstation.dao;

import java.util.List;
import java.util.Map;

import com.bone.common.BaseIbatisDAO;
import com.bone.page.Page;
import com.bone.vo.EmployeeRoleVO;
import com.bone.workstation.po.EmployeeRole;

public class EmployeeRoleDAO extends BaseIbatisDAO {

	
	/**
	 * 取符合查询条件的数据. 
	 * @param parameter
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Page<EmployeeRole> queryEmployeeRolePageByParam(Map<String, Object> para,Page page){
		Long totalResultSize = (Long) getSqlMapClientTemplate().queryForObject("EMPLOYEE_ROLE.queryByParamCount", para);
		//分页查询
		page.setTotalResultSize(totalResultSize);				
		para.put("startRows", page.getStartRows());				
		para.put("endRows", page.getEndRows());
		page.setItems(getSqlMapClientTemplate().queryForList("EMPLOYEE_ROLE.queryByParam", para));
		return page;
	}
	
	/**
	 * 取用户的角色列表数据.
	 * @param parameter
	 * @return
	 */
	public List<EmployeeRoleVO> queryEmployeeRoleVoByParam(Map<String, Object> map){
		return  (List) getSqlMapClientTemplate().queryForList("EMPLOYEE_ROLE.queryEmployeeRoleVoByParam", map);
	}
	
	
	/**
	 * 取用户的角色列表数据.
	 * @param parameter
	 * @return
	 */
	public List<EmployeeRole> queryEmployeeRoleListByParam(Map<String, Object> map){
		return  (List) getSqlMapClientTemplate().queryForList("EMPLOYEE_ROLE.queryEmployeeRoleListByParam", map);
	}
	
	
	
}
